module BoolfuckTranslators where

-- | Boolfuck to Brainfuck (proto-)translator
-- It's not very useful, to be honest.
boolfToBrainf :: [Char] -> [Char]
-- TODO: Change this to check for the patterns below within a single text (MUCH later on).
-- Also, this is pretty much useless
boolfToBrainf txt =  concat $ map (boolfToBrainfStrings) $ lines txt

boolfToBrainfStrings :: [Char] -> [Char]
boolfToBrainfStrings ">[>]+<[+<]>>>>>>>>>[+]<<<<<<<<<" = "+"
boolfToBrainfStrings ">>>>>>>>>+<<<<<<<<+[>+]<[<]>>>>>>>>>[+]<<<<<<<<<" = "-"
boolfToBrainfStrings "<<<<<<<<<" = "<"
boolfToBrainfStrings ">>>>>>>>>" = ">"
boolfToBrainfStrings ">,>,>,>,>,>,>,>,<<<<<<<<" = ","
boolfToBrainfStrings ">;>;>;>;>;>;>;>;<<<<<<<<" = "."
boolfToBrainfStrings ">>>>>>>>>+<<<<<<<<+[>+]<[<]>>>>>>>>>[+<<<<<<<<[>]+<[+<]" = "["
boolfToBrainfStrings ">>>>>>>>>+<<<<<<<<+[>+]<[<]>>>>>>>>>]<[+<]" = "]"
boolfToBrainfStrings _ = ""